//
//  OwnerCell.m
//  Commerce
//
//  Created by xiaofeifei on 15/2/13.
//  Copyright (c) 2015年 fei. All rights reserved.
//

#import "OwnerCell.h"

@implementation OwnerCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)configUIWithData:(NSDictionary *)data{
    _nameLabel.text = [data[@"CarNo"]isEqual:[NSNull null]]?@"":data[@"CarNo"];
    _cityLabel.text = [NSString stringWithFormat:@"%@-%@",[data[@"StartingCityName"]isEqual:[NSNull null]]?@"":data[@"StartingCityName"],[data[@"DestinationCityName"]isEqual:[NSNull null]]?@"":data[@"DestinationCityName"]];
    _typeLabel.text = [data[@"CarTypeName"]isEqual:[NSNull null]]?@"":data[@"CarTypeName"];
    _statusLabel.text = [[data[@"OrderName"]isEqual:[NSNull null]]?@"":data[@"OrderName"] stringByAppendingString:[data[@"UpdateTime"]isEqual:[NSNull null]]?@"":data[@"UpdateTime"]];
    _msgLabel.text = [data[@"CarSpecName"]isEqual:[NSNull null]]?@"":data[@"CarSpecName"];
    
    Star *star1 = [[Star alloc] initWithFrame:_starView.frame];
    star1.show_star = [[data[@"VipLevel"]isEqual:[NSNull null]]?@"0":data[@"VipLevel"] integerValue] *20;
    star1.font_size = 8;
    star1.full_color = [UIColor colorWithRed:246/255.0 green:145/255.0 blue:10/255.0 alpha:1.0];
    star1.empty_color = [UIColor colorWithRed:203/255.0 green:203/255.0 blue:203/255.0 alpha:1.0];
    [self.contentView addSubview:star1];
}

@end
